from .Exporter import Exporter
from .LuaExporter import LuaExporter
from .JsonExporter import JsonExporter
from .TypescriptExporter import TypescriptExporter
from .JavascriptExporter import JavascriptExporter

class ExporterFactory:
    def create_exporter(lang: str) -> Exporter:
        exporters = {
            'lua': LuaExporter,
            'json': JsonExporter,
            'ts': TypescriptExporter,
            'js': JavascriptExporter,
            'typescript': TypescriptExporter,
            'javascript': JavascriptExporter,
        }

        exporter_class = exporters.get(lang.lower())
        if not exporter_class:
            raise ValueError(f"不支持的语言: {lang}")

        return exporter_class()